<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%
	String path = request.getContextPath();
	if(!path.contains("pwtz")){
		response.sendRedirect("/pwtz");
		return;
	}
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=9">
<link href="<%=basePath%>web/css/style.css" rel="stylesheet"
	type="text/css" />
<link href="<%=basePath%>web/css/index.css" rel="stylesheet"
	type="text/css" />
<link href="<%=basePath%>web/css/qq.css" rel="stylesheet"
	type="text/css" />
<script src="<%=basePath%>web/js/jQuery.js" type="text/javascript"></script>
<script src="<%=basePath%>web/js/format.js" type="text/javascript"></script>
<script type="text/javascript">
var contextPath = "<%=basePath%>";
var typelist;
	function goToPage(pageNo, pageSize, restype) {
		$.ajax({
					url : contextPath + "resource/list",
					data : {
						pagesize : pageSize,
						pageno : pageNo,
						restype : restype
					},
					type : 'POST',
					success : function(list) {
						var div='reslist'+restype;
						
							$("#"+div).empty();
							if (list != null && list.totalRecord > 0) {
								var obj = list.records;
								for (var i = 0; i < obj.length; i++) {
									var content = '<li class="cont_li"><p class="left"><a href="'+contextPath+'web/newsinfo.jsp?resid='
											+ obj[i].resid
											+ '"> '
											+ obj[i].resname
											+ '</a></p><p class="right">'
											+ new Date(obj[i].publishtime)
													.format("yyyy-MM-dd")
											+ '</p></li>';
									$("#"+div).append(content);
								}
							}
						

					}

				});

	}

	$(function() {
		$(".suspend").mouseover(function() {
	        $(this).stop();
	        $(this).animate({width: 160}, 400);
	    });
	    $(".suspend").mouseout(function() {
	        $(this).stop();
	        $(this).animate({width: 40}, 400);
	    });
		
		$.ajax({
			url:contextPath+"restype/list",
			type:"post",
			async:false,
			success:function(data){
				typelist = data;
				$("#res_type").empty();
				$(".tabdiv_box").empty();
				var style;
				for (var i = 0; i < data.length; i++) {
					if(data[i].typeId == 4 || data[i].typeId >=100){
						continue;
					}
					if(i==0){
						style='block';
					}
					else{
						style='none';
					}
					var content=
					'<div id="tab'+data[i].typeId+'" onclick="changetab('+data[i].typeId+');">'+data[i].typeName+'</div>'
				   $("#res_type").append(content);
					
				     var div = 
				    	 '<div class="tab'+data[i].typeId+'"  style="display:'+style+'" >'+
						'<ul class="cont_ul" id="reslist'+data[i].typeId+'">'+
							'<div class="clear"></div>'+
						'</ul>'+
					  '</div>';
					$(".tabdiv_box").append(div);
				}
				$("#res_type").append('<a href="<%=basePath%>web/newslist.jsp" class="more">更多&gt;</a>');
				changetab(data[0].typeId);
			}
		});
	});
	function changetab(restype){
		for (var i = 0; i < typelist.length; i++) {
			if(restype == typelist[i].typeId){
				$(".tab"+restype).show();
				$("#tab"+restype).attr('class','news_cur');
				continue;
			}
			$(".tab"+typelist[i].typeId).hide();
			$("#tab"+typelist[i].typeId).attr('class','news');
			
			
		}
		 goToPage(1, 6, restype);
	}
</script>
<title>首页</title>
</head>
<body>
	<!-- 头部区域_begin -->
	<div class="container">
		<div class="header">
			<p class="pwysj_p">配网云数据</p>
			<ul>
				<li class="li_cur"><a href="<%=basePath%>web/home.jsp"
					class="cur">首页</a></li>
						<li><a href="<%=basePath%>web/jjfa.jsp">解决方案</a></li>
				<li><a href="<%=basePath%>web/download.jsp">下载</a></li>
				<li><a href="<%=basePath %>web/experience.jsp">体验</a></li>
				<li><a href="<%=basePath%>web/about.jsp">关于</a></li>
			</ul>
			<div class="right">
				<a href="<%=basePath%>user/login.jsp" class="login">登 录</a> <a
					href="<%=basePath%>user/register.jsp" class="regist">注 册</a>
			</div>
		</div>
	</div>
	
	<!-- qq begin-->
	<div class="suspend">
	<dl>
		<dt class="IE6PNG"></dt>
		<dd class="suspendQQ"><a target="_blank" href="http://wpa.qq.com/msgrd?v=3&uin=718822186&site=qq&menu=yes"></a></dd>
		<dd class="suspendTel"><a href="javascript:void(0);"></a></dd>
	</dl>
</div>
	
	<!-- qq end -->
	<!-- 头部区域_end -->

	<!-- 图片轮播_begin -->
	<div class="imgshow_div">
		<img class="show_bg_img" src="<%=basePath %>web/images/pwysj_index_bg.jpg" alt="" />
		<!-- 轮换区域_begin -->
		<div class="out_box">
			<div class="left_btn">
				<img src="<%=basePath%>web/images/btn_left.png" alt="" />
			</div>
			<div class="center_div">
				<ul class="img_ul">
					<li class="img_li"><a
						href="<%=basePath%>web/images/flash_img1.jpg"><img
							src="<%=basePath%>web/images/flash_img1.jpg" alt="" /></a></li>
					<li class="img_li"><a href="<%=basePath%>web/images/flash_img2.png"><img
							src="<%=basePath %>web/images/flash_img2.png" alt="" /></a></li>
					<li class="img_li"><a href="<%=basePath%>web/images/flash_img3.png"><img
							src="<%=basePath %>web/images/flash_img3.png" alt="" /></a></li>
					<li class="img_li"><a href="<%=basePath%>web/images/flash_img4.png"><img
							src="<%=basePath %>web/images/flash_img4.png" alt="" /></a></li>
					<div class="clear"></div>
				</ul>
				<ul class="point_ul">
					<li class="point_li"><div class="cur"></div></li>
					<li class="point_li"><div></div></li>
					<li class="point_li"><div></div></li>
					<li class="point_li"><div></div></li>
					<div class="clear"></div>
				</ul>
			</div>
			<div class="right_btn">
				<img src="<%=basePath %>web/images/btn_right.png" alt="" />
			</div>
			<div class="clear"></div>
		</div>
		<!-- 轮换区域_end --> 
		<a href="<%=basePath %>download/android/pwzs.apk" class="index_android"></a>
		<a href="javascript:void(0)" class="index_ios"></a>
		<a href="<%=basePath %>web/experience.jsp" class="index_ljty"></a>
		<div class="scan"></div>
		<p class="scan_p">扫一扫，下载配网数据助手APP！</p>
	</div>
	<!-- 图片轮播_end -->

	<!-- 主体区域_begin -->
	<div class="container">
		<!-- 产品介绍_begin -->
		<div class="index_show_cont">
			<div class="index_cont_box">
				<img src="<%=basePath %>web/images/pwysj_index_17.jpg" alt="" />
				<p class="p1">现场数据采集</p>
				<p class="p2">定位、拍照、记录，现场数据采集只需带上它既可轻松搞定。</p>
			</div>

			<div class="index_cont_box">
				<img src="<%=basePath %>web/images/pwysj_index_19.jpg" alt="" />
				<p class="p1">设备图形生成</p>
				<p class="p2">自动生成单线图，并可根据需要自动生成CAD单线图并提供导出功能。</p>
			</div>

			<div class="index_cont_box">
				<img src="<%=basePath %>web/images/pwysj_index_22.jpg" alt="" />
				<p class="p1">数据接口管理</p>
				<p class="p2">系内置多个通用导入导出模板，并为其他系统应用提供开放接口。</p>
			</div>

			<div class="index_cont_box" style="border-right: none;">
				<img src="<%=basePath %>web/images/pwysj_index_25.jpg" alt="" />
				<p class="p1">设备台账管理</p>
				<p class="p2">中低压配网设备进行维护。实现设备的增加、修改、删除等，可批量操作。</p>
			</div>
		</div>
		<!-- 产品介绍_begin -->

		<!-- 新闻列表-联系我们_begin -->
		<div class="index_sec_box">
			<!-- 左侧_begin -->
			<div class="left_box">
				<h2 id="res_type">
					<div class="news_cur" onclick="goToPage(1, 6, 1);">最新消息</div>
					<div class="download" onclick="goToPage(1, 6, 2);">资料下载</div>
					<a href="<%=basePath%>web/newslist.jsp" class="more">更多&gt;</a>
				</h2>
				<!-- tab_begin -->
				<div class="tabdiv_box">
					<!--最新消息_begin -->
					<div class="cont_news">
						<ul class="cont_ul" id="msglist">
							<div class="clear"></div>
						</ul>
					</div>
					<!--最新消息_end -->
					<!--资料下载_begin -->
					<div class="cont_download" style="display: none;">
						<ul class="cont_ul" id="reslist">
							<div class="clear"></div>
						</ul>
					</div>
					
					
					<!--资料下载_end -->
				</div>
				<!-- tab_end -->
			</div>
			<!-- 左侧_end -->

			<!-- 右侧_begin -->
			<div class="right_box">
				<h2>联系我们</h2>
				<div class="cont">
					<img class="ewm" src="<%=basePath%>web/images/pwysj_index_32.jpg" alt="" />
					<p class="p1">扫一扫，关注微信</p>
					<p class="p2">联系电话：028-12345678</p>
					<p class="p3">在 线 QQ：11223344556</p>
				</div>
			</div>
			<!-- 右侧_end -->
		</div>
		<!-- 新闻列表-联系我们_end -->
	</div>
	<!-- 主体区域_end -->

	<!-- 底部区域_begin -->
<%@ include file="/web/foot.jsp"%>
	<!-- 底部区域_end -->
	<script src="<%=basePath %>web/js/show_common.js" type="text/javascript"></script>
</body>
</html>
